<template>
	<view class="realInfo">
		<image src="../../static/index/realIcon.png" mode="" class="realIcon"></image>
		<view class="passTips">实名认证通过</view>
		<view class="infoBoxOut">
			<view class="listBoxIn">
				<text>姓名</text>
				<text class="blackRight">{{userInfo.name}}</text>
			</view>
			<view class="listBoxIn">
				<text>单位</text>
				<text class="blackRight">{{userInfo.deptName}}</text>
			</view>
			<view class="listBoxIn">
				<text>手机号</text>
				<text class="blackRight">{{userInfo.phoneNumber}}</text>
			</view>
			<view class="listBoxIn">
				<text>认证日期</text>
				<text class="blackRight">{{userInfo.createTime}}</text>
			</view>
		</view>
		<view class="logoutBtn" @tap="logout()">退出</view>
	</view>
</template>

<script>
	import {checkUserInfo} from  '../index/js/api.js'
	export default{
		data () {
			return {
				userInfo: {}
			}
		},
		onLoad() {
			this.getInfo()
		},
		methods:{
			getInfo() {
				let unionid = uni.getStorageSync('unionid')
				let params = {
					unionid: unionid
				}
				checkUserInfo(params).then(res => {
					console.log(res)
					if (res.code === 200) {
						this.userInfo = res.data
					}
				})
			},
			logout () {
				uni.clearStorageSync()
				uni.reLaunch({
					url: '../index/index'
				})
				// uni.remov
			}
		}
	}
</script>

<style lang="scss">
	.realInfo{
		display: flex;
		justify-content: flex-start;
		align-items: center;
		flex-direction: column;
		.realIcon{
			width: 260rpx;
			height: 260rpx;
			margin: 40rpx auto 0;
		}
		.passTips{
			width: 100%;
			text-align: center;
			color: #333333;
			font-size: 34rpx;
			margin-top: 30rpx;
			// font-weight: 500;
		}
		.infoBoxOut{
			width: 690rpx;
			height: 370rpx;
			background: #FFFFFF;
			box-shadow: 0px 4rpx 20rpx 0px rgba(102, 102, 102, 0.3);
			border-radius: 10rpx;
			margin-top: 60rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			flex-direction: column;
			.listBoxIn{
				width: calc(100% - 60rpx);
				height: 90rpx;
				border-bottom: 1rpx solid #eee;
				color: #999999;
				font-size: 30rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				// font-weight: 500;
				.blackRight{
					color: #333333;
				}
			}
			.listBoxIn:last-child{
				border-bottom: 0;
			}
		}
		.logoutBtn{
			border: 0!important;
			border: none!important;
			width: 690rpx;
			height: 90rpx;
			background: #2DBDA2;
			border-radius: 10rpx;
			text-align: center;
			line-height: 90rpx;
			color: #FFFFFF;
			font-weight: 34rpx;
			font-weight: 500;
			margin-top: 80rpx;
		}
	}
</style>
